export default function(){
    function header(){

    }
    $.extend(header.prototype,{
        init : function(){
            this.nav_wrapper = $(".nav-wrapper")[0];
            this.brand_logo  = $(".brand_logo");
            var timer        = null ;
            $(window).scroll($.proxy(function(){ //需要去抖
                clearInterval(timer);
                timer = setInterval($.proxy(function(){
                    var scroll = $("body,html").scrollTop();
                    this.TopFixed(scroll)
                },this),50)
            },this));
        },
        TopFixed : function(data){           
            var top = this.brand_logo.offset().top;
            if( data >= top){
                this.nav_wrapper.style.display = "block";
                this.nav_wrapper.style.position = "fixed";
            }
            if( data < top){
                this.nav_wrapper.style.display = "none";
                this.nav_wrapper.style.position = "static";
            }
        }
    })
    return new header();
}